package com.lxlg.lxlg_order.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000119604198";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9bnE4f6B2mVcJxHcZ8v1uZ0a18JjWe68KsejG87tZmwhbvB4g0V8goEhXRtOxJesRgH9EpMyCEdz56B6jUsLNH40RmkeDXvX6RKfS8KVT7AQJqIjgRCIvrmCaumKWzLly033EXA2Z9wDmwOzMLzKlEsdN4/gYUfv83MgqbAwSkgQ8SoP49ggRGtGreOc/JkvY45KO0TatThN9mMloBHtfRa9bKVUcdPj+8yn++epwFwDoyOaMlaANXOQsXAkdpMRKV5y23oZe7q4CRMeVP2TxrDYsMSQ3mszE7sj61hkBIgk5Cwgxwjmjx1mMCh4LXzAXEfNIA+IsVI+qxTxfEnuPAgMBAAECggEADL/xOOdGKpVZiVvC1GlJa3PiC37dGpqKhoLA8xsWggpwPpRjxruw1mZTWCR5PRQbRTtL1Zft99cx81QPM9jvKZU1Dnk+1PXAQo76aLUvu31ILEo+pDGRx3nKIL/owNOYq8TWUzAK7lD0q5NSnM+Ubg3cgj6UxTZHapaFlm1dRqaVXW/Qqvsiutv+UBUrWdMC235GUR2IfhjKMoIUWDeuPj86yh09c1HakpWqsph0VtDYJ9Mw3+zkzPu96k0FygGODbdQscXXCNcaKUU08zePv7dlSEFtRAD9FE917n1jzNjPnGvFM1Pfs2530MAwLL9oR7fVrAPSePITU+rcMdEisQKBgQD8Q6lPA5jPjeIEb47BwFMFsk7bZxsd3ePfoqoMwT7lO7efEILH8WgNtsDLtaKdskL/YnFIU3fI2pwuStsR35lTiIq9FCkJbR9FG8HTpJx1yC7tXn9ScGNhzf6W6Ty2AhrFhPIBj4HPYJKhIw96uptlgmPz/cQTdPbF9sSUcZAQWQKBgQDAPJSMfVsIOfADfnRsPhfkVF0+TM40dQkIMb1MVUlrT94YG0p48FuQqUc+wd/dLeLsTXI3YBKY7pYPMmkbg36j0Em+qmWVKhkO7ADwFcASFYQw2sUOsRb4cNeS71a+Y+s0xkyVoW9OnovC2A+mzSlpemHjcO5aikxNkB/9QrAuJwKBgHzAkUgsBTQPfIipCrYygFw+09SY5sYcZ4a/EM2B+7Ktl58oMSTj84tkp2+Wgbbu40cczdzwujowMjCKgFAUfeTbj5D2GV06A87PbUlXDLEKsHpe0yRXxC4oCxFigs2XuNmZZ3zyFUYTAjCCADO3eQX4N6oAAymEHE3GPW0TxCTxAoGAZes4bsu/Sbs97vxKSWEaVaoMzYz2/oTWRwvn6uKEzGpJu8osT7ZPNYEqDrHHOIKtfs8IsSc0dPR5hpEZfMbYi41Qq8+3j8AEDQ8+6AsADBZwQV6bf1CQdyOMh5BxEvvypcZEsEgotSwFuUXH9o1rWUrTPzyOgl40WiMBcsq6kZ0CgYEA9FdEhwpcmWYRHS+aCiSTYfJinyvhOOwF5Keoe2QTVR6ZGVD0aYA0zukmGaegvBYbg2tu79B1J/qk+z33lv+tLgf1mPatByAcyxxttYd3zWZB1835Tgy6bVuHv+cF5Vmjhcjo0psy/gM6nNYxDM+i207b5EikVdY+enHyFyU26qc=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuf9B99AXniWFx555sK85bNY355kMx270G2q/gnPO5bRgdEIWehKzIBQsj9iFPU22H/S8lVZj5GxhYJ644Bt16SgU5QICP9kFTz3qsWMwavKiuNMCtz3Im+un4ua2DFBG/kOx2NIPBbkJbt1YARSdHr0TpyRPcILo8l/9ie1TiVdMjafoY4j++a2ej/dGtsSRpCx7G+KXGJtImUAahFSPWNHmNP4ZEBJZUj30y7Ei7qxJdGw44OmwuFnvyxvypSsWWaCWNpEgUGxhVKSJsfOTbHbiXVbZg+wfSB+7c1F0oiKimr+czB2nowkypImwngls1jQo0gjPvU+R+ULSH9C3zQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://xdsca8.natappfree.cc/orderservice/allOrderPayBack/payBack.do";
	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://xdsca8.natappfree.cc/orderservice/templates/payback.html";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

